import React, {Component} from 'react';
import './index.css';
import {InputNumber, Slider, Radio, Select} from 'antd';
import BaseOpts from '../BaseOpts';
import SlideInput from '../../common/SlideInput/index';

class AgentSearchOpts extends BaseOpts {

    static defaultProps = {
        data: {
            style: {},
            dataset: {}
        }
    };

    constructor(props) {
        super(props);

        this.state = {
            data: props.data,
        };
    }

    render() {
        var {data} = this.state;
        var {style, dataset} = data;
        var marginTop = parseFloat(style.marginTop || 0);
        var marginBottom = parseFloat(style.marginBottom || 0);

        return (
            <div className="optsPanel">
                <div className="optsPanel__item">
                    <label className="optsPanel__item__hd">上外边距</label>
                    <div className="optsPanel__item__bd">
                        <SlideInput
                            step={1}
                            min={0}
                            max={300}
                            value={marginTop}
                            onChange={(val) => {
                                this.$dataChange('marginTop', val + 'px', 'style');
                            }}
                        />
                    </div>
                </div>

                <div className="optsPanel__item">
                    <label className="optsPanel__item__hd">下外边距</label>
                    <div className="optsPanel__item__bd">
                        <SlideInput
                            step={1}
                            min={0}
                            max={300}
                            value={marginBottom}
                            onChange={(val) => {
                                this.$dataChange('marginBottom', val + 'px', 'style');
                            }}
                        />
                    </div>
                </div>

                <div className="optsPanel__item">
                    <div className="optsPanel__item__bd">
                        <a href="/admin/User/daiLiIndex" target="_blank"
                           className="ant-btn-dataMng ant-btn ant-btn-primary ant-btn-lg">代理管理</a>
                    </div>
                </div>
            </div>
        );
    }

    componentDidMount() {
    }
}

export default AgentSearchOpts;
